<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="utf-8">
  <title>Twitter Bootstrap: Dropdown on Hover Plugin Demo</title>
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta name="description" content="A demo for my simple plugin that enables twitter bootstrap dropdowns to activate on hover and provide a nice user experience.">
  <meta name="author" content="Cameron Spear">

  <!-- <link href="http://twitter.github.com/bootstrap/assets/css/bootstrap.css" rel="stylesheet"> -->
  <link href="http://netdna.bootstrapcdn.com/twitter-bootstrap/2.1.1/css/bootstrap-combined.min.css" rel="stylesheet">

  <style type="text/css">
    body { padding-top: 60px; min-height: 410px }

    @media only screen and (max-width: 979px) {
      body { padding-top: 0; }
    }
  </style>

  <!--[if lt IE 9]>
    <script src="//html5shim.googlecode.com/svn/trunk/html5.js"></script>
  <![endif]-->
</head>
<body>

  <div class="navbar navbar-fixed-top">
    <div class="navbar-inner">
      <div class="container">
        <a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
          <span class="icon-bar"></span>
          <span class="icon-bar"></span>
          <span class="icon-bar"></span>
        </a>
        <a class="brand" href="http://cameronspear.com/blog/twitter-bootstrap-dropdown-on-hover-plugin/">Dropdown Hover Plugin</a>
        <div class="nav-collapse collapse">
          <ul class="nav">
            <li class="dropdown">
              <a href="#" class="dropdown-toggle js-activated">Home <b class="caret"></b></a>
              <ul class="dropdown-menu">
                <li><a tabindex="-1" href="#">Why Would</a></li>
                <li><a tabindex="-1" href="#">A Home Tab</a></li>
                <li><a tabindex="-1" href="#">Have Dropdowns?</a></li>
              </ul>
            </li>
            <li class="dropdown">
              <a href="#" class="dropdown-toggle js-activated">Account <b class="caret"></b></a>
              <ul class="dropdown-menu">
                <li><a tabindex="-1" href="#">My Account</a></li>
                <li class="divider"></li>
                <li><a tabindex="-1" href="#">Change Email</a></li>
                <li><a tabindex="-1" href="#">Change Password</a></li>
                <li class="divider"></li>
                <li><a tabindex="-1" href="#">Logout</a></li>
              </ul>
            </li>
            <li class="dropdown">
              <a href="#" class="dropdown-toggle js-activated">Contact <b class="caret"></b></a>
              <ul class="dropdown-menu">
                <li><a tabindex="-1" href="#">Contact</a></li>
                <li><a tabindex="-1" href="#">Contact My Mom</a></li>
                <li class="divider"></li>
                <li><a tabindex="-1" href="#">Contact Your Mom</a></li>
                <li><a tabindex="-1" href="#">Contact the President</a></li>
              </ul>
            </li>
          </ul>
        </div> <!-- .nav-collapse -->
      </div> <!-- .container -->
    </div> <!-- .navbav-inner -->
  </div> <!-- .navbar -->

  <div class="container">

    <h1>Twitter Bootstrap: Dropdown on Hover Plugin Demo</h1>
    <p>Hover over the nav items to see that they activate on hover. I'm setting the instantlyCloseOthers flag to true, so when you hover over a new nav item, the other ones instantly close (instead of waiting for their timeouts). See <a href="http://cameronspear.com/blog/twitter-bootstrap-dropdown-on-hover-plugin/">cameronspear.com/blog/twitter-bootstrap-dropdown-on-hover-plugin/</a> for more.</p>

    <h2><em>New!</em> Try it with data-attributes</h2>

    <div class="navbar">
      <div class="navbar-inner">
        <div class="container">
          <a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
          </a>
          <a class="brand" href="http://cameronspear.com/blog/twitter-bootstrap-dropdown-on-hover-plugin/">Dropdown Hover Plugin</a>
          <div class="nav-collapse collapse">
            <ul class="nav">
              <li class="dropdown">
                <a href="#" class="dropdown-toggle" data-hover="dropdown" data-delay="1000">1000ms Delay <b class="caret"></b></a>
                <ul class="dropdown-menu">
                  <li><a tabindex="-1" href="#">Why Would</a></li>
                  <li><a tabindex="-1" href="#">A Home Tab</a></li>
                  <li><a tabindex="-1" href="#">Have Dropdowns?</a></li>
                </ul>
              </li>
              <li class="dropdown">
                <a href="#" class="dropdown-toggle" data-hover="dropdown" data-close-others="false">Doesn't Close Others <b class="caret"></b></a>
                <ul class="dropdown-menu">
                  <li><a tabindex="-1" href="#">My Account</a></li>
                  <li class="divider"></li>
                  <li><a tabindex="-1" href="#">Change Email</a></li>
                  <li><a tabindex="-1" href="#">Change Password</a></li>
                  <li class="divider"></li>
                  <li><a tabindex="-1" href="#">Logout</a></li>
                </ul>
              </li>
              <li class="dropdown">
                <a href="#" class="dropdown-toggle" data-hover="dropdown">Defaults <b class="caret"></b></a>
                <ul class="dropdown-menu">
                  <li><a tabindex="-1" href="#">Contact</a></li>
                  <li><a tabindex="-1" href="#">Contact My Mom</a></li>
                  <li class="divider"></li>
                  <li><a tabindex="-1" href="#">Contact Your Mom</a></li>
                  <li><a tabindex="-1" href="#">Contact the President</a></li>
                </ul>
              </li>
            </ul>
          </div> <!-- .nav-collapse -->
        </div> <!-- .container -->
      </div> <!-- .navbav-inner -->
    </div> <!-- .navbar -->

    <h3>It also works with buttons and tabs</h3>
    <p>Just add <code>data-hover="dropdown"</code> where you'd put <code>data-toggle="dropdown"</code></p>

    <div class="btn-toolbar">
      <div class="btn-group">
        <button class="btn dropdown-toggle" data-toggle="dropdown" data-hover="dropdown">Action <span class="caret"></span></button>
        <ul class="dropdown-menu">
          <li><a href="#">Action</a></li>
          <li><a href="#">Another action</a></li>
          <li><a href="#">Something else here</a></li>
          <li class="divider"></li>
          <li><a href="#">Separated link</a></li>
        </ul>
      </div> <!-- .btn-group -->
      <div class="btn-group">
        <button class="btn btn-primary dropdown-toggle" data-toggle="dropdown" data-hover="dropdown">Action <span class="caret"></span></button>
        <ul class="dropdown-menu">
          <li><a href="#">Action</a></li>
          <li><a href="#">Another action</a></li>
          <li><a href="#">Something else here</a></li>
          <li class="divider"></li>
          <li><a href="#">Separated link</a></li>
        </ul>
      </div> <!-- .btn-group -->
      <div class="btn-group">
        <button class="btn btn-danger dropdown-toggle" data-toggle="dropdown" data-hover="dropdown">Danger <span class="caret"></span></button>
        <ul class="dropdown-menu">
          <li><a href="#">Action</a></li>
          <li><a href="#">Another action</a></li>
          <li><a href="#">Something else here</a></li>
          <li class="divider"></li>
          <li><a href="#">Separated link</a></li>
        </ul>
      </div> <!-- .btn-group -->
      <div class="btn-group">
        <button class="btn btn-warning dropdown-toggle" data-toggle="dropdown" data-hover="dropdown">Warning <span class="caret"></span></button>
        <ul class="dropdown-menu">
          <li><a href="#">Action</a></li>
          <li><a href="#">Another action</a></li>
          <li><a href="#">Something else here</a></li>
          <li class="divider"></li>
          <li><a href="#">Separated link</a></li>
        </ul>
      </div> <!-- .btn-group -->
      <div class="btn-group">
        <button class="btn btn-success dropdown-toggle" data-toggle="dropdown" data-hover="dropdown">Success <span class="caret"></span></button>
        <ul class="dropdown-menu">
          <li><a href="#">Action</a></li>
          <li><a href="#">Another action</a></li>
          <li><a href="#">Something else here</a></li>
          <li class="divider"></li>
          <li><a href="#">Separated link</a></li>
        </ul>
      </div> <!-- .btn-group -->
      <div class="btn-group">
        <button class="btn btn-info dropdown-toggle" data-toggle="dropdown" data-hover="dropdown">Info <span class="caret"></span></button>
        <ul class="dropdown-menu">
          <li><a href="#">Action</a></li>
          <li><a href="#">Another action</a></li>
          <li><a href="#">Something else here</a></li>
          <li class="divider"></li>
          <li><a href="#">Separated link</a></li>
        </ul>
      </div> <!-- .btn-group -->
      <div class="btn-group">
        <button class="btn btn-inverse dropdown-toggle" data-toggle="dropdown" data-hover="dropdown">Inverse <span class="caret"></span></button>
        <ul class="dropdown-menu">
          <li><a href="#">Action</a></li>
          <li><a href="#">Another action</a></li>
          <li><a href="#">Something else here</a></li>
          <li class="divider"></li>
          <li><a href="#">Separated link</a></li>
        </ul>
      </div> <!-- .btn-group -->
    </div> <!-- .btn-toolbar -->

    <div class="tabs-example">
      <ul id="myTab" class="nav nav-tabs">
        <li class="active"><a href="#home" data-toggle="tab">Home</a></li>
        <li><a href="#profile" data-toggle="tab">Profile</a></li>
        <li class="dropdown">
          <a href="#" class="dropdown-toggle" data-toggle="dropdown" data-hover="dropdown">Dropdown <b class="caret"></b></a>
          <ul class="dropdown-menu">
            <li><a href="#dropdown1" data-toggle="tab">@fat</a></li>
            <li><a href="#dropdown2" data-toggle="tab">@mdo</a></li>
          </ul>
        </li>
      </ul>
      <div id="myTabContent" class="tab-content">
        <div class="tab-pane fade in active" id="home">
          <p>Raw denim you probably haven't heard of them jean shorts Austin. Nesciunt tofu stumptown aliqua, retro synth master cleanse. Mustache cliche tempor, williamsburg carles vegan helvetica. Reprehenderit butcher retro keffiyeh dreamcatcher synth. Cosby sweater eu banh mi, qui irure terry richardson ex squid. Aliquip placeat salvia cillum iphone. Seitan aliquip quis cardigan american apparel, butcher voluptate nisi qui.</p>
        </div>
        <div class="tab-pane fade" id="profile">
          <p>Food truck fixie locavore, accusamus mcsweeney's marfa nulla single-origin coffee squid. Exercitation +1 labore velit, blog sartorial PBR leggings next level wes anderson artisan four loko farm-to-table craft beer twee. Qui photo booth letterpress, commodo enim craft beer mlkshk aliquip jean shorts ullamco ad vinyl cillum PBR. Homo nostrud organic, assumenda labore aesthetic magna delectus mollit. Keytar helvetica VHS salvia yr, vero magna velit sapiente labore stumptown. Vegan fanny pack odio cillum wes anderson 8-bit, sustainable jean shorts beard ut DIY ethical culpa terry richardson biodiesel. Art party scenester stumptown, tumblr butcher vero sint qui sapiente accusamus tattooed echo park.</p>
        </div>
        <div class="tab-pane fade" id="dropdown1">
          <p>Etsy mixtape wayfarers, ethical wes anderson tofu before they sold out mcsweeney's organic lomo retro fanny pack lo-fi farm-to-table readymade. Messenger bag gentrify pitchfork tattooed craft beer, iphone skateboard locavore carles etsy salvia banksy hoodie helvetica. DIY synth PBR banksy irony. Leggings gentrify squid 8-bit cred pitchfork. Williamsburg banh mi whatever gluten-free, carles pitchfork biodiesel fixie etsy retro mlkshk vice blog. Scenester cred you probably haven't heard of them, vinyl craft beer blog stumptown. Pitchfork sustainable tofu synth chambray yr.</p>
        </div>
        <div class="tab-pane fade" id="dropdown2">
          <p>Trust fund seitan letterpress, keytar raw denim keffiyeh etsy art party before they sold out master cleanse gluten-free squid scenester freegan cosby sweater. Fanny pack portland seitan DIY, art party locavore wolf cliche high life echo park Austin. Cred vinyl keffiyeh DIY salvia PBR, banh mi before they sold out farm-to-table VHS viral locavore cosby sweater. Lomo wolf viral, mustache readymade thundercats keffiyeh craft beer marfa ethical. Wolf salvia freegan, sartorial keffiyeh echo park vegan.</p>
        </div>
      </div>
    </div> <!-- .tabs-example -->
    
  </div> <!-- .container -->

  <script src="http://code.jquery.com/jquery-latest.min.js"></script>
  <!-- // <script src="http://twitter.github.com/bootstrap/assets/js/bootstrap.min.js"></script> -->
  <script scr="http://netdna.bootstrapcdn.com/twitter-bootstrap/2.1.1/js/bootstrap.min.js"></script>
  <script src="twitter-bootstrap-hover-dropdown.js"></script>

  <script>
    // very simple to use!
    $(document).ready(function() {
      $('.js-activated').dropdownHover();
    });
  </script>

    
</body>
</html>
